﻿
/*----------------------------------------------------------------//
// 文件名：MoKeptLog.cs
// 文件功能描述：实体 MoKeptLog.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoKeptLog
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoKeptLog
	/// </summary>
	public partial class MoKeptLog:ICloneable
	{
		#region 表KeptLog的字段
		private int _kpt_log_id;
		private string _equip_id;
		private DateTime _kpt_begin;
		private string _user_code1;
		private string _user_code2;
		private DateTime _kpt_end;
		private string _kpt_addr;
		private int _kpt_status;
		private string _rem;
		#endregion
		
		#region 构造函数
		public MoKeptLog()
		{
		    
		    
		    _kpt_begin= DateTime.Now;
		    
		    
		    _kpt_end= DateTime.Now;
		    
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoKeptLog(MoKeptLog item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoKeptLog(int kpt_log_id,string equip_id,DateTime kpt_begin,string user_code1,string user_code2,DateTime kpt_end,string kpt_addr,int kpt_status,string rem)
		{
		this._kpt_log_id=kpt_log_id;
		this._equip_id=equip_id;
		this._kpt_begin=kpt_begin;
		this._user_code1=user_code1;
		this._user_code2=user_code2;
		this._kpt_end=kpt_end;
		this._kpt_addr=kpt_addr;
		this._kpt_status=kpt_status;
		this._rem=rem;
		}
		#endregion
		
		#region 表KeptLog的字段属性
		/// <summary>
		/// KPT_LOG_ID
		/// </summary>
		public int Kpt_Log_Id
		{
			get {return _kpt_log_id;}
			set {_kpt_log_id=value;}
		}
		/// <summary>
		/// EQUIP_ID
		/// </summary>
		public string Equip_Id
		{
			get {return _equip_id;}
			set {_equip_id=value;}
		}
		/// <summary>
		/// KPT_BEGIN
		/// </summary>
		public DateTime Kpt_Begin
		{
			get {return _kpt_begin;}
			set {_kpt_begin=value;}
		}
		/// <summary>
		///没有人交接时，则为空。
		/// </summary>
		public string User_Code1
		{
			get {return _user_code1;}
			set {_user_code1=value;}
		}
		/// <summary>
		/// USER_CODE2
		/// </summary>
		public string User_Code2
		{
			get {return _user_code2;}
			set {_user_code2=value;}
		}
		/// <summary>
		///实际就是交接日期.
		/// </summary>
		public DateTime Kpt_End
		{
			get {return _kpt_end;}
			set {_kpt_end=value;}
		}
		/// <summary>
		/// KPT_ADDR
		/// </summary>
		public string Kpt_Addr
		{
			get {return _kpt_addr;}
			set {_kpt_addr=value;}
		}
		/// <summary>
		///0--未知，1--在管,2--已交接
		/// </summary>
		public int Kpt_Status
		{
			get {return _kpt_status;}
			set {_kpt_status=value;}
		}
		/// <summary>
		/// REM
		/// </summary>
		public string Rem
		{
			get {return _rem;}
			set {_rem=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoKeptLog CopyTo(MoKeptLog item)
        {
		    item.Kpt_Log_Id=this.Kpt_Log_Id;
		    item.Equip_Id=this.Equip_Id;
		    item.Kpt_Begin=this.Kpt_Begin;
		    item.User_Code1=this.User_Code1;
		    item.User_Code2=this.User_Code2;
		    item.Kpt_End=this.Kpt_End;
		    item.Kpt_Addr=this.Kpt_Addr;
		    item.Kpt_Status=this.Kpt_Status;
		    item.Rem=this.Rem;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoKeptLog NewKeptLog=new MoKeptLog();
		    NewKeptLog._kpt_log_id=this._kpt_log_id;
		    NewKeptLog._equip_id=this._equip_id;
		    NewKeptLog._kpt_begin=this._kpt_begin;
		    NewKeptLog._user_code1=this._user_code1;
		    NewKeptLog._user_code2=this._user_code2;
		    NewKeptLog._kpt_end=this._kpt_end;
		    NewKeptLog._kpt_addr=this._kpt_addr;
		    NewKeptLog._kpt_status=this._kpt_status;
		    NewKeptLog._rem=this._rem;
			return NewKeptLog;
		}
		
		private static MoKeptLog _empty = new MoKeptLog(-1,string.Empty,DateTime.MinValue,string.Empty,string.Empty,DateTime.MinValue,string.Empty,-1,string.Empty);
        public static MoKeptLog Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoKeptLog NewKeptLog = obj as MoKeptLog;
                if (NewKeptLog == null)
                {
                    return false;
                }
                else
                {
				if (NewKeptLog.Kpt_Log_Id==this.Kpt_Log_Id && NewKeptLog.Equip_Id==this.Equip_Id && NewKeptLog.Kpt_Begin==this.Kpt_Begin && NewKeptLog.User_Code1==this.User_Code1 && NewKeptLog.User_Code2==this.User_Code2 && NewKeptLog.Kpt_End==this.Kpt_End && NewKeptLog.Kpt_Addr==this.Kpt_Addr && NewKeptLog.Kpt_Status==this.Kpt_Status && NewKeptLog.Rem==this.Rem)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Kpt_Log_Id={0}/Equip_Id={1}/Kpt_Begin={2}/User_Code1={3}/User_Code2={4}/Kpt_End={5}/Kpt_Addr={6}/Kpt_Status={7}/Rem={8}",_kpt_log_id,_equip_id,_kpt_begin,_user_code1,_user_code2,_kpt_end,_kpt_addr,_kpt_status,_rem);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Kpt_Log_ID"]!=null && row["Kpt_Log_ID"]!=DBNull.Value)
			{
			    this.Kpt_Log_Id = (int)row["Kpt_Log_ID"];
			}
			else
			{
				this.Kpt_Log_Id =-1;
			}
		    if(row["Equip_ID"]!=null && row["Equip_ID"]!=DBNull.Value)
			{
			    this.Equip_Id = (string)row["Equip_ID"];
			}
			else
			{
				this.Equip_Id =string.Empty;
			}
		    if(row["Kpt_Begin"]!=null && row["Kpt_Begin"]!=DBNull.Value)
			{
			    this.Kpt_Begin = (DateTime)row["Kpt_Begin"];
			}
			else
			{
				this.Kpt_Begin =DateTime.MinValue;
			}
		    if(row["User_Code1"]!=null && row["User_Code1"]!=DBNull.Value)
			{
			    this.User_Code1 = (string)row["User_Code1"];
			}
			else
			{
				this.User_Code1 =string.Empty;
			}
		    if(row["User_Code2"]!=null && row["User_Code2"]!=DBNull.Value)
			{
			    this.User_Code2 = (string)row["User_Code2"];
			}
			else
			{
				this.User_Code2 =string.Empty;
			}
		    if(row["Kpt_End"]!=null && row["Kpt_End"]!=DBNull.Value)
			{
			    this.Kpt_End = (DateTime)row["Kpt_End"];
			}
			else
			{
				this.Kpt_End =DateTime.MinValue;
			}
		    if(row["Kpt_Addr"]!=null && row["Kpt_Addr"]!=DBNull.Value)
			{
			    this.Kpt_Addr = (string)row["Kpt_Addr"];
			}
			else
			{
				this.Kpt_Addr =string.Empty;
			}
		    if(row["Kpt_Status"]!=null && row["Kpt_Status"]!=DBNull.Value)
			{
			    this.Kpt_Status = (int)row["Kpt_Status"];
			}
			else
			{
				this.Kpt_Status =-1;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Kpt_Log_ID"] = this.Kpt_Log_Id;
			row["Equip_ID"] = this.Equip_Id;
			row["Kpt_Begin"] = this.Kpt_Begin;
			row["User_Code1"] = this.User_Code1;
			row["User_Code2"] = this.User_Code2;
			row["Kpt_End"] = this.Kpt_End;
			row["Kpt_Addr"] = this.Kpt_Addr;
			row["Kpt_Status"] = this.Kpt_Status;
			row["Rem"] = this.Rem;
		}
		#endregion
	}
}
#endregion
